/*
 * MPlayerX - MPApplication.m
 *
 * Copyright (C) 2009 - 2012, Zongyao QU
 * 
 * MPlayerX is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * MPlayerX is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with MPlayerX; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#import "MPApplication.h"
#import "CocoaAppendix.h"
#import "def.h"
#ifdef MPX_NOSANDBOX
#import "SPMediaKeyTap.h"
#endif

@implementation MPApplication

#ifdef MPX_NOSANDBOX
-(void) sendEvent:(NSEvent*)theEvent
{
	// If event tap is not installed, handle events that reach the app instead	
	if((![SPMediaKeyTap usesGlobalMediaKeyTap]) && 
	   [theEvent type] == NSSystemDefined && 
	   [theEvent subtype] == SPSystemDefinedEventMediaKeys) {
		[(id)[self delegate] mediaKeyTap:nil receivedMediaKeyEvent:theEvent];
	}
	[super sendEvent:theEvent];
}
#endif // MPX_NOSANDBOX
@end
